<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jkui Home</title>
<link type="text/css" rel="stylesheet" href="css/layout.css" />
<link type="text/css" rel="stylesheet" href="css/theme.css" />
</head>

<body>
	<div>
    	<div class="header">
        	<h1><a href="index.html">Project jkui Home</a></h1>
        </div>
        <div class="columns">
        	<div class="left navigation">
				<h2>Navigation</h2>
            	<ul class="menu">
                	<li><a href="about.html">About</a></li>
                    <li><a href="http://code.google.com/p/jkui/downloads/list">Download</a></li>
					<li><a href="docs/index.html">Docs</a></li>
					<li><a href="contact.html">Contact</a></li>
                </ul>
            </div>
            <div class="middle">
				<h2 class="content-title">The super lightweight JavaScript OO framework</h2>
				<ol class="blog">
				<li class="node">
					<h1 class="title">Core feature preview</h1>
					<h3>A little bullsh*t</h3>
					<p>The code is still under development, I just highlight a few features which has been or is going to be supported in the framework.</p>
					<p>As you may know that the "jkui" framework is a composition of 2 parts - the OO core, and a widget library which is mainly for online desktop applications. The features I am going to present today is the OO core. The widget library is still at the very beginning stage so I can't tell anything specific.</p>
					<h3>Features from OO core</h3>
					<ul>
						<li>
							<strong>OO features</strong>
							<ul>
								<li>Class definition is as simple as what you did in traditional JavaScript (function with prototype).</li>
								<li>Class extension is a function call with parent class and the new class's constructor. To override or define new methods, you just need to do the same with the old fasion (use the "prototype" property).</li>
								<li>By calling the "extendAbstract" function, an abstract class (only inforcement is that it cannot be instantiated) can be created.</li>
								<li>A child class can call parent class's constructor by calling "this.Super()", and in fact this call is compulsary (same as Java, it's only that we don't have a "compiler" to do the checking).</li>
								<li>A new concept (well, at least new to Java and C++) called implementation injection is introduced. Similar to the "interface" concept in Java, the only difference is that the "implementation" is an "implemented interface" (though it makes huge difference in concept, they are syntactically similar).</li>
								<li>Automatic destructor chaining is available (it will call the destructor function in the order from children to parents, one after another automatically, and returns null, no matter how you define it.</li>
							</ul>
						</li>
						<li>
							<strong>Event model</strong>
							<ul>
								<li>"bind" an event with one or more event handlers is available, as they are available in frameworks like jQuery, mootools, YUI and more others, also, the browsers support it natively for DOM elements in different ways.</li>
								<li>"unbind" works the same as jQuery.</li>
								<li>"trigger" will return a boolean. If all event handlers return "true" or "undefined", it returns true, otherwise false. This emulates the native event model of browsers (by return false, you stop the event propagation immediately).</li>
								<li><em>Note: </em>Event propagation is not supported natively, because the framework is only about OO. I'm considering moving this event model out of the OO core, because it sounds more like implementation of a class created under the framework, rather than a part of the framework.</li>
							</ul>
						</li>
						<li>
							<strong>Misc.</strong>
							<ul>
								<li>Accessors like "each" are supported.</li>
								<li>It doesn't pollute JavaScript built in objects.</li>
								<li>Like jQuery, it can work with other frameworks.</li>
							</ul>
						</li>
					</ul>
					<div class="footer">
						<span class="author">By Kangol</span> | <span class="time">16th Jan. 2010</span>
					</div>
					</li>
				</ol>
            </div>
        </div>
		<div class="footer">
			<p>(c) 2009-2010 - The jkui Group</p>
		</div>
    </div>
</body>
</html>
